<div>
    <?php if (!isset($this->erros)): ?>

        <?php $start = false; $classFunc="funcionarios"; ?>
        <div>
            <form id="buscaUsers" action="<?= $this->form->getAction() ?>" method="post">

                <? foreach ($this->form as $element): ?>
                     
                    <?php
                        if ($element->getid()== "tipo_pessoa" && $element->getValue() == 2):
                              $classFunc = "";  
                        endif;
                    ?>    
                
                    <?php if (!is_null($element->getAttrib("class")) && $element->getAttrib("class") == "funcionario" && !$start): ?>
                        <?php $start = true; ?>
                        <div id="funcionarios" class="<?= $classFunc ?>">
                        <?php endif; ?>
                        <?php if (is_null($element->getAttrib("class")) && $start): ?>        
                            <?php $start = false; ?>
                        </div>
                    <?php endif; ?>
                    
                    <?= $element ?>
                <? endforeach ?>
                
                <input  type="submit" id="btnEnviar" value="Salvar" class="btn-large"/>
                <input  type="button" id="btnExcluir" value="Excluir" class="btn-large"/>
                <p style="margin-top: 15px;">*preencher somente se for primeiro cadastro ou se quiser modificar</p>
            </form>

        </div>
    <?php else: ?>
        <a href="<?= $this->url(array('controller' => 'consulta', 'action' => 'index')) ?>"> Voltar</a>
    <?php endif; ?>

</div>
